﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Globalization;
using System.Collections.Generic;
using WindowsFormsApplication1.QLSVEntities;

namespace WindowsFormsApplication1.QLSVData
{
    public class SinhvienDAO : BaseDAO
    {
        public SinhvienDAO()
        {

        }
        //private Sinhvien CreateUserFromReader(IDataReader reader)
        //{
        //    Sinhvien sv = new Sinhvien();
        //    sv.ID = (int)reader["ID"];
        //    sv.MasvID = (string)reader["MasvID"];
        //    sv.MalopID = (string)reader["MalopID"];
        //    sv.Holot = (string)reader["Holot"];
        //    sv.Ten = (string)reader["Ten"];
        //    sv.Ngaysinh = (DateTime)reader["Ngaysinh"];
        //    sv.Noisinh = (string)reader["Noisinh"];
        //    sv.Phai = (int)reader["Phai"];
        //    sv.Diachi = (string)reader["Diachi"];
        //    sv.Dienthoai = (string)reader["Dienthoai"];
        //    sv.Email = (string)reader["Email"];
        //    sv.NamTNPT = (int)reader["NamTNPT"];
        //    sv.Thi_TT = (string)reader["Thi_TT"];
        //    sv.MadantocID =(string)reader["MadantocID"];
        //    sv.MatongiaoID =(string)reader["MatongiaoID"];
        //    sv.Quoctich =(string)reader["Quoctich"];
        //    sv.Hotencha =(string)reader["Hotencha"];
        //    sv.Nghenghiepcha =(string)reader["Nghenghiepcha"];
        //    sv.Hotenme =(string)reader["Hotenme"];
        //    sv.Nghenghiepme =(string)reader["Nghenghiepme"];
        //    sv.Hinh =(string)reader["Hinh"];
        //    sv.Ghichu =(string)reader["Ghichu"];
        //    sv.Check1 =(int)reader["Check1"];
        //    sv.Check2 =(int)reader["Check2"];
        //    sv.Check3 =(int)reader["Check3"];
        //    sv.Check4 =(int)reader["Check4"];
        //    sv.Check5 =(int)reader["Check5"];
        //    sv.Duphong1 =(int)reader["Duphong1"];
        //    sv.Duphong2 =(int)reader["Duphong2"];
        //    return sv;
        //}
        public DataTable GetSinhvienByID(long ID)
        {
            SqlConnection connection = ConnectionData();
            string sql = "SELECT * FROM T01_Sinh_vien";
            SqlDataAdapter da = new SqlDataAdapter(sql, connection);
            DataTable dt = new DataTable();
            da.Fill(dt);
            da.Update(dt);
            connection.Close();
            return dt;
        }
    }
}
